home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-01-16 | 1.8 KB | 79 lines | [TEXT/MPS ] |
- # Quit and save state for fast startup
-
- # We need to set Exit to 0 so that errors won't
- # cause Quit or Startup to bomb, but we also want
- # to maintain the user's setting of the Exit
- # variable. Save and restore it.
- Set SaveExit {Exit}
- Export SaveExit
- Set Exit 0
-
- # State saving is turned off by creating a file
- # named DontSaveState in the MPW folder.
- If "`Exists "{ShellDirectory}"DontSaveState`"
- Delete -i "{ShellDirectory}"DontSaveState ∂
- "{ShellDirectory}"MPW.SuspendState ∂
- ≥ Dev:Null
-
- Else
-
- # Write the state to a temporary file.
- Begin
-
- # Tell the restoration not to bomb.
- Echo Set Exit 0
-
- # Save the custom menus.
- AddMenu
-
- # Save the current directory.
- Echo Directory "`Directory`"
-
- # Save the open windows.
- Echo For window In "`Windows`"
- Echo ' Open "{window}" || Set Status 0'
- Echo 'End ≥ Dev:Null'
-
- # Save the aliases.
- Alias
-
- # Save the variables.
- Set
-
- # Save the exports. This runs much faster
- # with all the exports on one line, so we
- # use -s to get all the names at once.
- Echo Export "`Export -s`"
-
- # Save the key assignments.
- SetKey
- # Save lines that will execute the UserMount
- # script if any. The script doesn't have to
- # exist, and it's harmless to throw it away
- # between saving and restoring state.
- If "`Exists "{ShellDirectory}"UserMount`"
- Echo Execute ∂
- "{ShellDirectory}"UserMount ∂
- "≥ Dev:Null"
- End
-
- # Save the mounted Projector databases and
- # their checkout directories.
- MountProject
- CheckOutDir -r
-
- # After the rest of the state is restored
- # with Exit set to 0 to prevent bombing,
- # save lines to restore the user's setting
- # of Exit.
- Echo Set Exit '{SaveExit}'
-
- End > "{ShellDirectory}"MPW.SuspendState ∂
- ≥ Dev:Null
-
- End
-
- # Sometimes anomalies prevent the Worksheet from
- # auto-saving at Quit time; make sure it does.
- Save "{Worksheet}"
-